SG FileSys | |
NameMask Property |
Enumerator Object Constants Error Codes |
Returns or sets file name mask.
object.NameMask As String
The object is expression that evaluates to the Enumerator object.
During enumeration process, file and folder names are matched against the name mask. If name is matched, that file or folder is accepted and emitted as next valid item. Inside name mask string, you can use wildcard characters:
* - matches 0 or more characters in file name text
? - matches exactly one character in file name text
Following example prints all directories with name that starts with letter 's' and ends with letter 'p':
Option Explicit Dim en, item Set en = CreateObject("SGFileSys.Enumerator") en.RootPath = "C:/" en.Recurse = True en.NameMask = "s*p.*" en.AttributeMask = sgfDirectory For Each item In en.Items WScript.Echo item.Path Next